home *** CD-ROM | disk | FTP | other *** search
- global monsterSO, monsterData, playerViewpoint
-
- on initializeMonsters
- monsterData = []
- repeat with wMonster = 1 to 25
- wSprite = monsterSO + wMonster
- puppetSprite(wSprite, 1)
- sprite(wSprite).visible = 0
- set the member of sprite wSprite to "Teeth 1"
- set the ink of sprite wSprite to 36
- set the loc of sprite wSprite to point(-50, -50)
- add(monsterData, [0, 0, point(0, 0), []])
- end repeat
- end
-
- on addMonster spawnType, spawnLoc, spawnParameters, spawnVariation
- validSlot = 0
- repeat with wSlot = 1 to count(monsterData)
- if (monsterData[wSlot][1] = 0) and (validSlot = 0) then
- validSlot = wSlot
- end if
- end repeat
- if validSlot <> 0 then
- wSprite = monsterSO + validSlot
- monsterData[validSlot] = [1, spawnType, spawnLoc, spawnParameters, 0, spawnVariation]
- sprite(wSprite).visible = 1
- end if
- end
-
- on initializeBossMonster
- global bossHitArea, bossHarmArea, bossData
- bossHitArea = []
- bossHarmArea = []
- bossData = [1, point(500, 500), 1, [point(0, 0), 0, 0, 0]]
- set the member of sprite 21 to "Fish Boss Normal"
- set the foreColor of sprite 21 to 255
- set the loc of sprite 21 to point(290, 600)
- end
-
- on moveBossMonster bossState
- global bossHitArea, bossHarmArea, bossData, playerLocData, screenShakeValue, rumbleOffset, bossIntro, eyeRoll, bossHealth, bossDamageTaken, hitIndicatorDelay, hitIndicatorLength
- hitDamage = 10
- if bossHealth <= 0 then
- bossData[3] = 7
- end if
- if bossState = 1 then
- harmless = 0
- case bossData[3] of
- 1:
- if bossData[2][2] > 500 then
- bossData[2][2] = bossData[2][2] - 4
- end if
- if bossData[2][1] < playerLocData[3][1] then
- bossData[4][1][1] = bossData[4][1][1] + 0.20000000000000001
- if bossData[4][1][1] > 20 then
- bossData[4][1][1] = 20
- end if
- leapSpeed = 10
- sprite(21).flipH = 0
- else
- bossData[4][1][1] = bossData[4][1][1] - 0.20000000000000001
- if bossData[4][1][1] < -20 then
- bossData[4][1][1] = -20
- end if
- leapSpeed = -10
- sprite(21).flipH = 1
- end if
- bossData[2] = bossData[2] + bossData[4][1]
- bossData[4][2] = bossData[4][2] + 1
- if bossData[4][2] >= 65 then
- if abs(abs(bossData[2][1]) - abs(playerLocData[3][1])) <= 250 then
- if bossIntro > 0 then
- bossData[3] = 3
- else
- bossData[3] = 1 + random(2)
- end if
- bossData[4][1][2] = -30
- bossData[4][1][1] = leapSpeed
- end if
- end if
- 2:
- bossData[4][1] = bossData[4][1] + point(0, 1)
- fishRotate = findAngle(point(0, 0), bossData[4][1])
- if bossData[4][1][2] < 0 then
- if bossData[4][1][1] > 0 then
- sprite(21).rotation = fishRotate - 90
- else
- sprite(21).rotation = fishRotate + 90
- end if
- else
- sprite(21).rotation = 0
- end if
- solidTest = checkSolidpoint(bossData[2] + point(0, 90))
- if bossData[2][2] > 500 then
- bossData[3] = 1
- screenShakeValue = 20
- playSound("Small Bomb SFX")
- bossData[4][3] = 0
- bossData[4][4] = 0
- else
- if (solidTest[1] = 1) and (bossData[4][1][2] > 0) then
- bossData[3] = 4
- screenShakeValue = 20
- bossData[4][3] = 0
- bossData[4][4] = 5
- playSound("Small Bomb SFX")
- else
- bossData[2] = bossData[2] + bossData[4][1]
- end if
- end if
- 3:
- bossData[2] = bossData[2] + bossData[4][1]
- bossData[4][1] = bossData[4][1] + point(0, 1)
- fishRotate = findAngle(point(0, 0), bossData[4][1])
- if bossData[4][1][1] < 0 then
- sprite(21).rotation = fishRotate + 90
- else
- sprite(21).rotation = fishRotate - 90
- end if
- solidTest = checkSolidpoint(bossData[2] + point(0, 110))
- if bossData[2][2] > 650 then
- bossData[2][2] = 650
- bossData[3] = 1
- bossData[4][2] = 0
- bossData[4][1][2] = 0
- screenShakeValue = 20
- playSound("Small Bomb SFX")
- sprite(21).rotation = 0
- end if
- 4:
- bossData[4][3] = bossData[4][3] + 1
- if (bossData[4][3] mod 20) = 0 then
- set the member of sprite 21 to "Fish Boss Normal"
- else
- if (bossData[4][3] mod 20) = 15 then
- if bossData[4][4] > 0 then
- set the member of sprite 21 to "Fish Boss Burp"
- if bossData[4][1][1] > 0 then
- spawnoffset = bossData[2] + point(80, 15)
- addMonster(1, spawnoffset, [point(6, random(3) - 2), point(0, 120), point(0, 0), 1], 2)
- else
- spawnoffset = bossData[2] + point(-80, 15)
- addMonster(1, spawnoffset, [point(-6, random(3) - 2), point(0, 120), point(0, 0), 1], 2)
- end if
- bossData[4][4] = bossData[4][4] - 1
- else
- bossData[3] = 5
- bossData[4][1][2] = 0
- end if
- end if
- end if
- hitDamage = 20
- 5:
- bossData[4][1][2] = bossData[4][1][2] + 1
- if bossData[4][1][2] > 30 then
- bossData[4][1][2] = 30
- end if
- bossData[2][2] = bossData[2][2] + bossData[4][1][2]
- if bossData[2][2] > 650 then
- bossData[2][2] = 650
- bossData[3] = 1
- bossData[4][2] = 0
- bossData[4][1][2] = 0
- end if
- 6:
- bossData[4][1][2] = bossData[4][1][2] + 0.5
- if bossData[4][1][2] > 30 then
- bossData[4][1][2] = 30
- end if
- bossData[2][2] = bossData[2][2] + bossData[4][1][2]
- if bossData[2][2] > 650 then
- bossData[2][2] = 650
- bossData[3] = 1
- bossData[4][2] = 0
- bossData[4][1][2] = 0
- end if
- eyeRoll = eyeRoll + 25
- hitDamage = 0
- 7:
- if bossData[4][1][2] < 6 then
- bossData[4][1][2] = bossData[4][1][2] + 0.10000000000000001
- end if
- if bossData[4][1][2] > 30 then
- bossData[4][1][2] = 30
- end if
- bossData[2][2] = bossData[2][2] + bossData[4][1][2]
- if bossData[2][2] > 650 then
- bossData[2][2] = 650
- bossData[3] = 1
- bossData[4][2] = 0
- bossData[4][1][2] = 0
- go(35)
- end if
- spawnPoint = bossData[2] + point(random(350) - 175, random(150) - 75)
- addparticle(spawnPoint, 0, 1)
- set the foreColor of sprite 21 to random(255)
- eyeRoll = eyeRoll + 25
- hitDamage = 0
- harmless = 1
- end case
- if playerLocData[6] = #Crouch then
- sprite(19).locZ = -10
- set the loc of sprite 19 to playerLocData[3] - playerViewpoint + rumbleOffset + point(0, 25)
- set the height of sprite 19 to 25
- else
- set the loc of sprite 19 to playerLocData[3] - playerViewpoint + rumbleOffset
- set the height of sprite 19 to 75
- end if
- set the loc of sprite 18 to playerLocData[3] - playerViewpoint + rumbleOffset + point(0, 50)
- bossDamageTaken = 0
- if sprite 19 intersects sprite(21) then
- if playerLocData[1] = 1 then
- bossDamageTaken = 1
- end if
- else
- if sprite 18 intersects sprite(20) and (harmless = 0) then
- playerLocData[5] = -45
- playerLocData[2] = 0
- bossData[3] = 6
- bossData[4][1][2] = 0
- bossHealth = bossHealth - hitDamage
- if hitDamage > 0 then
- hitIndicatorDelay = 30
- hitIndicatorLength = hitDamage * 3
- addScore(hitDamage * 10)
- playSound("Boss Hit SFX")
- end if
- end if
- end if
- set the loc of sprite 21 to bossData[2] - playerViewpoint + rumbleOffset
- set the loc of sprite 20 to bossData[2] - playerViewpoint + rumbleOffset
- sprite(20).rotation = sprite(21).rotation
- sprite(20).flipH = sprite(21).flipH
- sprite(20).visible = 1
- sprite(21).visible = 1
- sprite(22).visible = 1
- case sprite(20).flipH of
- 0:
- eyeCenterAim = 123 - sprite(20).rotation
- 1:
- eyeCenterAim = 123 + sprite(20).rotation
- end case
- locY = integer(cos(eyeCenterAim * PI / 180) * 113)
- locX = integer(sin(eyeCenterAim * PI / 180) * 113)
- case sprite(20).flipH of
- 0:
- locX = locX
- 1:
- locX = 0 - locX
- end case
- fishSocketLocation = bossData[2] - playerViewpoint + rumbleOffset + point(locX, locY)
- playerDrawLocation = playerLocData[3] - playerViewpoint + rumbleOffset
- if bossData[3] <> 6 then
- lookingAtYouAim = findAngle(fishSocketLocation, playerDrawLocation)
- set the member of sprite 20 to "Giant Fin"
- else
- lookingAtYouAim = eyeRoll mod 360
- if (eyeRoll mod 2) = 0 then
- set the member of sprite 20 to "Giant Fin Hurt"
- else
- set the member of sprite 20 to "Giant Fin"
- end if
- end if
- locY2 = integer(cos(lookingAtYouAim * PI / 180) * -10)
- locX2 = integer(sin(lookingAtYouAim * PI / 180) * 10)
- set the loc of sprite 22 to fishSocketLocation + point(locX2, locY2)
- if bossHealth < 0 then
- bossHealth = 0
- end if
- set the width of sprite 24 to bossHealth * 3
- else
- sprite(21).visible = 0
- end if
- indicatorOffset = point(155, 10)
- set the loc of sprite 23 to indicatorOffset + rumbleOffset
- set the loc of sprite 24 to indicatorOffset + rumbleOffset + point(0, 5)
- set the loc of sprite 25 to indicatorOffset + rumbleOffset + point(the width of sprite 24, 5)
- set the loc of sprite 26 to point(322, 35) + rumbleOffset
- if hitIndicatorDelay > 0 then
- hitIndicatorDelay = hitIndicatorDelay - 1
- set the width of sprite 25 to hitIndicatorLength
- else
- if hitIndicatorLength > 0 then
- hitIndicatorLength = hitIndicatorLength - 1
- set the width of sprite 25 to hitIndicatorLength
- end if
- end if
- end
-
- on moveMonsters
- global monsterHitArea, monsterHarmArea, playerLocData, rumbleOffset, screenTileSize
- monsterHitArea = []
- monsterHarmArea = []
- repeat with wMonster = 1 to count(monsterData)
- wSprite = monsterSO + wMonster
- if monsterData[wMonster][1] = 1 then
- if findDistance(playerViewpoint + point(290, 220), monsterData[wMonster][3]) <= 600 then
- case monsterData[wMonster][2] of
- 1:
- curLoc = monsterData[wMonster][3]
- solidTestA = checkSolidpoint(curLoc + point(15, 0))
- solidTestB = checkSolidpoint(curLoc - point(15, 0))
- if (solidTestA[1] <> 1) or (solidTestB[1] <> 1) then
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][1]
- if moveSpeed[1] > 0 then
- solidTest = checkSolidpoint(curLoc + point(15, 0))
- killtest = checkSolidpoint(curLoc - point(15, 0))
- if solidTest[1] = 1 then
- if killtest[1] = 1 then
- deleteEnemy = 1
- else
- monsterData[wMonster][4][1][1] = 0 - abs(moveSpeed[1])
- end if
- end if
- monsterFlip = 1
- else
- if moveSpeed[1] < 0 then
- solidTest = checkSolidpoint(curLoc - point(15, 0))
- killtest = checkSolidpoint(curLoc + point(15, 0))
- if solidTest[1] = 1 then
- if killtest[1] = 1 then
- deleteEnemy = 1
- else
- monsterData[wMonster][4][1][1] = abs(moveSpeed[1])
- end if
- end if
- monsterFlip = 0
- end if
- end if
- moveSpeed[2] = 0
- driftSpd = monsterData[wMonster][4][2]
- driftMoment = monsterData[wMonster][4][3]
- repeat with wvect = 1 to 2
- if driftSpd[wvect] > 0 then
- driftMoment[wvect] = driftMoment[wvect] - 1
- next repeat
- end if
- driftMoment[wvect] = driftMoment[wvect] + 1
- end repeat
- driftSpd = driftSpd + driftMoment
- monsterData[wMonster][4][2] = driftSpd
- monsterData[wMonster][4][3] = driftMoment
- monsterData[wMonster][3] = monsterData[wMonster][3] + moveSpeed
- deleteEnemy = 0
- if findDistance(playerViewpoint + point(290, 220), monsterData[wMonster][3]) >= 500 then
- if monsterData[wMonster][6] = 2 then
- deleteEnemy = 1
- end if
- end if
- if monsterData[wMonster][5] >= 1 then
- addScore(30)
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- rpoint = monsterData[wMonster][3]
- addparticle(rpoint, 0, 1)
- monsterData[wMonster][1] = 0
- repeat with wCoin = 1 to 1
- addPickup(1, 1, monsterData[wMonster][3], point([-3, 0, 3][wCoin], 5 - random(3)))
- end repeat
- else
- if deleteEnemy = 1 then
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- monsterData[wMonster][1] = 0
- else
- monsterData[wMonster][4][4] = monsterData[wMonster][4][4] + 1
- if monsterData[wMonster][4][4] > 2 then
- monsterData[wMonster][4][4] = 1
- end if
- set the member of sprite wSprite to "teeth" & " " & string(monsterData[wMonster][4][4])
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- sprite(wSprite).flipH = monsterFlip
- curLoc = monsterData[wMonster][3]
- add(monsterHitArea, rect(curLoc[1] - 25, curLoc[2] - 25, curLoc[1] + 25, curLoc[2] + 25))
- add(monsterHarmArea, rect(curLoc[1] - 15, curLoc[2] - 15, curLoc[1] + 15, curLoc[2] + 20))
- end if
- end if
- else
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- monsterData[wMonster][1] = 0
- end if
- 2:
- monsterData[wMonster][4][1] = monsterData[wMonster][4][1] + monsterData[wMonster][4][2]
- curLoc = monsterData[wMonster][3]
- solidTest = checkSolidpoint(curLoc)
- locY = integer(cos(monsterData[wMonster][4][1] * PI / 180) * -70)
- locX = integer(sin(monsterData[wMonster][4][1] * PI / 180) * 70)
- boomloc = monsterData[wMonster][3] + point(locX, locY)
- if solidTest[1] = 0 then
- addScore(60)
- monsterData[wMonster][1] = 0
- set the loc of sprite wSprite to point(-50, -50)
- set the member of sprite wSprite to "Void Block"
- sprite(wSprite).rotation = 0
- addparticle(boomloc, 0, 1)
- repeat with wCoin = 1 to 1
- addPickup(1, 1, monsterData[wMonster][3], point([-3, 0, 3][wCoin], 5 - random(3)))
- end repeat
- else
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- set the member of sprite wSprite to "Spinning eye"
- sprite(wSprite).rotation = monsterData[wMonster][4][1]
- end if
- curLoc = boomloc
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(curLoc[1] - 10, curLoc[2] - 10, curLoc[1] + 10, curLoc[2] + 10))
- 3:
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][1]
- if moveSpeed[1] > 0 then
- solidTest = checkSolidpoint(curLoc + point(15, 0))
- if solidTest[1] = 1 then
- monsterData[wMonster][4][1][1] = 0 - abs(moveSpeed[1])
- end if
- monsterFlip = 1
- else
- if moveSpeed[1] < 0 then
- solidTest = checkSolidpoint(curLoc - point(15, 0))
- if solidTest[1] = 1 then
- monsterData[wMonster][4][1][1] = abs(moveSpeed[1])
- end if
- monsterFlip = 0
- end if
- end if
- if moveSpeed[2] > 0 then
- solidTest = checkSolidpoint(curLoc + point(0, 15))
- if solidTest[1] = 1 then
- monsterData[wMonster][4][1][2] = 0 - abs(moveSpeed[2])
- end if
- else
- if moveSpeed[2] < 0 then
- solidTest = checkSolidpoint(curLoc - point(0, 15))
- if solidTest[1] = 1 then
- monsterData[wMonster][4][1][2] = abs(moveSpeed[2])
- end if
- end if
- end if
- monsterData[wMonster][3] = monsterData[wMonster][3] + moveSpeed
- if monsterData[wMonster][5] >= 1 then
- addScore(45)
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- rpoint = monsterData[wMonster][3]
- addparticle(rpoint, 0, 1)
- monsterData[wMonster][1] = 0
- repeat with wCoin = 1 to 1
- addPickup(1, 1, monsterData[wMonster][3], point([-3, 0, 3][wCoin], 5 - random(3)))
- end repeat
- else
- monsterData[wMonster][4][4] = monsterData[wMonster][4][4] + 1
- if monsterData[wMonster][4][4] > 2 then
- monsterData[wMonster][4][4] = 1
- end if
- set the member of sprite wSprite to "Rolling Eye"
- sprite(wSprite).rotation = monsterData[wMonster][3][1] mod 360
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- curLoc = monsterData[wMonster][3]
- add(monsterHitArea, rect(curLoc[1] - 25, curLoc[2] - 25, curLoc[1] + 25, curLoc[2] + 25))
- add(monsterHarmArea, rect(curLoc[1] - 15, curLoc[2] - 15, curLoc[1] + 15, curLoc[2] + 15))
- end if
- 4:
- case monsterData[wMonster][6] of
- 1:
- monName1 = "FallingRat"
- monName2 = "Rat"
- spawnedMinion = 1
- jumpCliffs = 1
- 2:
- monName1 = "NewTiny"
- monName2 = "NewTiny"
- spawnedMinion = 0
- jumpCliffs = 0
- end case
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][1]
- floorTest = checkSolidpoint(curLoc + point(0, 25))
- if floorTest[1] = 0 then
- monsterData[wMonster][4][4] = monsterData[wMonster][4][4] + 1
- if monsterData[wMonster][4][4] > 9 then
- monsterData[wMonster][4][4] = 1
- end if
- if monsterData[wMonster][4][4] > 6 then
- set the member of sprite wSprite to monName1 & "1"
- else
- if monsterData[wMonster][4][4] > 3 then
- set the member of sprite wSprite to monName1 & "2"
- end if
- end if
- if monsterData[wMonster][4][1] < 10 then
- monsterData[wMonster][4][1][2] = monsterData[wMonster][4][1][2] + 1
- end if
- floorTest = checkSolidpoint(curLoc + point(0, 50))
- if floorTest[1] = 1 then
- if playerLocData[3][1] < curLoc[1] then
- monsterData[wMonster][4][1][1] = 0 - abs(monsterData[wMonster][4][1][1])
- else
- monsterData[wMonster][4][1][1] = abs(monsterData[wMonster][4][1][1])
- end if
- standBlock = monsterData[wMonster][3][2]
- end if
- else
- removeEnemy = 0
- existingBlock = curLoc[2] / 50
- newLandLoc = (existingBlock * 50) + 25
- monsterData[wMonster][4][4] = monsterData[wMonster][4][4] + 1
- if monsterData[wMonster][4][4] > 9 then
- monsterData[wMonster][4][4] = 1
- end if
- if monsterData[wMonster][4][4] > 6 then
- set the member of sprite wSprite to monName2 & "1"
- else
- if monsterData[wMonster][4][4] > 3 then
- set the member of sprite wSprite to monName2 & "2"
- else
- set the member of sprite wSprite to monName2 & "3"
- end if
- end if
- killTest1 = checkSolidpoint(curLoc + point(20, 0))
- killtest2 = checkSolidpoint(curLoc + point(-20, 0))
- if (killTest1[1] = 1) and (killtest2[1] = 1) then
- removeEnemy = 1
- end if
- if moveSpeed[2] > 0 then
- monsterData[wMonster][3][2] = monsterData[wMonster][3][2] - (monsterData[wMonster][3][2] mod screenTileSize) + integer(screenTileSize / 2.0) + 10
- monsterData[wMonster][4][1][2] = 0
- else
- if moveSpeed[1] > 0 then
- solidTest = checkSolidpoint(curLoc + point(20, 20))
- walltest = checkSolidpoint(curLoc + point(20, 0))
- if jumpCliffs = 1 then
- solidTest = [1, 0]
- end if
- if (solidTest[1] = 0) or (walltest[1] = 1) then
- monsterData[wMonster][4][1][1] = 0 - abs(moveSpeed[1])
- end if
- monsterFlip = 1
- else
- if moveSpeed[1] < 0 then
- solidTest = checkSolidpoint(curLoc + point(-20, 20))
- walltest = checkSolidpoint(curLoc + point(-20, 0))
- if jumpCliffs = 1 then
- solidTest = [1, 0]
- end if
- if (solidTest[1] = 0) or (walltest[1] = 1) then
- monsterData[wMonster][4][1][1] = abs(moveSpeed[1])
- end if
- monsterFlip = 0
- else
- monsterData[wMonster][4][1][1] = abs(4)
- monsterFlip = 0
- end if
- end if
- end if
- moveSpeed[2] = 0
- end if
- driftSpd = monsterData[wMonster][4][2]
- driftMoment = monsterData[wMonster][4][3]
- repeat with wvect = 1 to 2
- if driftSpd[wvect] > 0 then
- driftMoment[wvect] = driftMoment[wvect] - 1
- next repeat
- end if
- driftMoment[wvect] = driftMoment[wvect] + 1
- end repeat
- driftSpd = driftSpd + driftMoment
- monsterData[wMonster][4][2] = driftSpd
- monsterData[wMonster][4][3] = driftMoment
- monsterData[wMonster][3] = monsterData[wMonster][3] + moveSpeed
- if findDistance(playerViewpoint + point(290, 220), curLoc) > 500 then
- removeEnemy = 1
- else
- if (curLoc[2] / 50) >= 10 then
- removeEnemy = 1
- end if
- end if
- if spawnedMinion = 0 then
- removeEnemy = 0
- end if
- if monsterData[wMonster][5] >= 1 then
- addScore(25)
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- rpoint = monsterData[wMonster][3]
- addparticle(rpoint, 0, 1)
- monsterData[wMonster][1] = 0
- repeat with wCoin = 1 to 1
- end repeat
- else
- if removeEnemy = 1 then
- monsterData[wMonster][1] = 0
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- else
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + point(0, -5) + rumbleOffset
- sprite(wSprite).flipH = monsterFlip
- curLoc = monsterData[wMonster][3]
- add(monsterHitArea, rect(curLoc[1] - 25, curLoc[2] - 25, curLoc[1] + 25, curLoc[2] + 25))
- add(monsterHarmArea, rect(curLoc[1] - 10, curLoc[2] - 10, curLoc[1] + 20, curLoc[2] + 20))
- end if
- end if
- 5:
- curLoc = monsterData[wMonster][3]
- driftSpd = monsterData[wMonster][4][2]
- driftMoment = monsterData[wMonster][4][3]
- repeat with wvect = 1 to 2
- if driftSpd[wvect] > 0 then
- driftMoment[wvect] = driftMoment[wvect] - 1
- next repeat
- end if
- driftMoment[wvect] = driftMoment[wvect] + 1
- end repeat
- driftSpd = driftSpd + driftMoment
- monsterData[wMonster][4][2] = driftSpd
- monsterData[wMonster][4][3] = driftMoment
- set the member of sprite wSprite to "Trampoline"
- set the loc of sprite wSprite to monsterData[wMonster][3] + driftSpd - playerViewpoint + rumbleOffset
- sprite(wSprite).flipH = monsterFlip
- curLoc = monsterData[wMonster][3] + driftSpd
- add(monsterHitArea, rect(curLoc[1] - 25, curLoc[2] - 25, curLoc[1] + 25, curLoc[2] + 25))
- add(monsterHarmArea, rect(curLoc[1] - 15, curLoc[2] - 15, curLoc[1] + 15, curLoc[2] + 15))
- 6:
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][2]
- floorTest = checkSolidpoint(curLoc + point(0, 20))
- if curLoc[1] > (playerLocData[3][1] + 200) then
- moveSpeed = moveSpeed - 1
- if moveSpeed < -20 then
- moveSpeed = -20
- end if
- else
- if curLoc[1] < (playerLocData[3][1] - 50) then
- moveSpeed = moveSpeed + 1
- if moveSpeed > 20 then
- moveSpeed = 20
- end if
- end if
- end if
- monsterData[wMonster][3] = monsterData[wMonster][3] + point(moveSpeed, 0)
- monsterData[wMonster][4][2] = moveSpeed
- if monsterData[wMonster][4][1] > 0 then
- monsterData[wMonster][4][1] = monsterData[wMonster][4][1] - 1
- else
- monsterData[wMonster][4][1] = 60 + random(20)
- addMonster(4, curLoc, [point(4, 4), point(0, 4), point(0, 0), 0], 1)
- end if
- if (monsterData[wMonster][4][1] <= 25) and ((monsterData[wMonster][4][1] mod 3) <> 0) then
- set the member of sprite wSprite to "Cloud2"
- else
- set the member of sprite wSprite to "Cloud1"
- end if
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(0, 0, 0, 0))
- if playerLocData[3][1] > (90 * 40) then
- addparticle(curLoc, 0, 7)
- repeat with wBolt = 1 to 20
- rAim = 360 / 20 * wBolt
- locY = integer(cos(rAim * PI / 180) * -5)
- locX = integer(sin(rAim * PI / 180) * 25)
- addMonster(7, curLoc, [0, point(locX, locY), point(0, 0), 0], 2)
- end repeat
- monsterData[wMonster][2] = 10
- playSound("Boss Hit SFX")
- end if
- 7:
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][2]
- floorTest = checkSolidpoint(curLoc + point(0, 20))
- monsterData[wMonster][4][2] = monsterData[wMonster][4][2] + point(0, 1)
- monsterData[wMonster][3] = monsterData[wMonster][3] + moveSpeed
- hitFloor = checkSolidpoint(curLoc + point(0, 20))
- if monsterData[wMonster][4][1] > 0 then
- monsterData[wMonster][4][1] = monsterData[wMonster][4][1] - 1
- else
- monsterData[wMonster][4][1] = 2
- end if
- if hitFloor[1] = 1 then
- punchBlock(monsterData[wMonster][3] + point(0, 25))
- monsterData[wMonster][1] = 0
- set the loc of sprite wSprite to point(-50, -50)
- else
- if (monsterData[wMonster][4][1] <= 25) and ((monsterData[wMonster][4][1] mod 3) <> 0) then
- set the member of sprite wSprite to "Lightning1"
- else
- set the member of sprite wSprite to "Lightning2"
- end if
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(curLoc[1] - 15, curLoc[2] - 15, curLoc[1] + 15, curLoc[2] + 15))
- end if
- 8:
- curLoc = monsterData[wMonster][3]
- floorTest = checkSolidpoint(curLoc + point(0, 20))
- if floorTest[1] = 1 then
- existingBlock = curLoc[2] / 50
- newLandLoc = (existingBlock * 50) + 25
- end if
- 9:
- curLoc = monsterData[wMonster][3]
- floorTest = checkSolidpoint(curLoc + point(0, 20))
- moveSpeed = monsterData[wMonster][4][1]
- jumpDelay = monsterData[wMonster][4][2]
- if monsterData[wMonster][4][4] > 0 then
- monsterData[wMonster][5] = 0
- monsterData[wMonster][4][4] = monsterData[wMonster][4][4] - 1
- if monsterData[wMonster][4][4] > 0 then
- set the foreColor of sprite (monsterSO + wMonster) to random(255)
- else
- set the foreColor of sprite (monsterSO + wMonster) to 255
- end if
- else
- if monsterData[wMonster][5] > 0 then
- monsterData[wMonster][4][3] = monsterData[wMonster][4][3] + 1
- monsterData[wMonster][5] = 0
- if monsterData[wMonster][4][3] < 2 then
- monsterData[wMonster][4][4] = 20
- end if
- monsterData[wMonster][4][1][1] = 0
- monsterData[wMonster][4][1][2] = abs(monsterData[wMonster][4][1][2])
- end if
- end if
- if monsterData[wMonster][5] >= 1 then
- end if
- if (monsterData[wMonster][4][2] < 0) or (floorTest[1] = 1) then
- monsterData[wMonster][4][1][2] = monsterData[wMonster][4][1][2] + 1
- if monsterData[wMonster][4][1][2] < 0 then
- celingTest = checkSolidpoint(monsterData[wMonster][3] - point(0, 20))
- if celingTest[1] = 1 then
- monsterData[wMonster][4][1][2] = abs(monsterData[wMonster][4][1][2])
- end if
- end if
- if monsterData[wMonster][4][1][1] > 0 then
- hitWall = checkSolidpoint(curLoc + point(20, 0))
- if hitWall[1] = 1 then
- monsterData[wMonster][4][1][1] = 0 - abs(monsterData[wMonster][4][1][1])
- end if
- else
- hitWall = checkSolidpoint(curLoc - point(20, 0))
- if hitWall[1] = 1 then
- monsterData[wMonster][4][1][1] = abs(monsterData[wMonster][4][1][1])
- end if
- end if
- monsterData[wMonster][3] = monsterData[wMonster][3] + monsterData[wMonster][4][1]
- floorTest = checkSolidpoint(monsterData[wMonster][3] + point(0, 20))
- if floorTest[1] = 1 then
- monsterData[wMonster][4][2] = 10
- wDir = random(2)
- monsterData[wMonster][4][1] = point([3, -3][wDir], -15)
- case wDir of
- 1:
- sprite(wSprite).flipH = 1
- 2:
- sprite(wSprite).flipH = 0
- end case
- existingBlock = curLoc[2] / 50
- newLandLoc = (existingBlock * 50) + 25
- monsterData[wMonster][3][2] = newLandLoc
- end if
- else
- if monsterData[wMonster][4][4] <= 0 then
- monsterData[wMonster][4][2] = monsterData[wMonster][4][2] - 1
- end if
- if monsterData[wMonster][4][2] <= 0 then
- end if
- end if
- if (monsterData[wMonster][4][3] >= 2) and (monsterData[wMonster][4][4] <= 0) then
- addScore(60)
- set the loc of sprite (monsterSO + wMonster) to point(-50, -50)
- addparticle(monsterData[wMonster][3], 0, 1)
- monsterData[wMonster][1] = 0
- addPickup(1, 2, monsterData[wMonster][3], point(0, 5 - random(3)))
- playSound("Small Bomb SFX")
- else
- set the member of sprite wSprite to "foot_eye1"
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- end if
- if monsterData[wMonster][4][4] <= 0 then
- add(monsterHitArea, rect(curLoc[1] - 25, curLoc[2] - 15, curLoc[1] + 25, curLoc[2] + 10))
- add(monsterHarmArea, rect(curLoc[1] - 15, curLoc[2] - 15, curLoc[1] + 15, curLoc[2] + 15))
- else
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(0, 0, 0, 0))
- end if
- 10:
- curLoc = monsterData[wMonster][3]
- moveSpeed = monsterData[wMonster][4][2]
- floorTest = checkSolidpoint(curLoc + point(0, 20))
- if curLoc[1] > (playerLocData[3][1] + 100) then
- moveSpeed = moveSpeed - 1
- if moveSpeed < -12 then
- moveSpeed = -12
- end if
- else
- if curLoc[1] < (playerLocData[3][1] - 100) then
- moveSpeed = moveSpeed + 1
- if moveSpeed > 12 then
- moveSpeed = 12
- end if
- end if
- end if
- monsterData[wMonster][3] = monsterData[wMonster][3] + point(moveSpeed, 0)
- monsterData[wMonster][4][2] = moveSpeed
- if monsterData[wMonster][4][1] > 0 then
- monsterData[wMonster][4][1] = monsterData[wMonster][4][1] - 1
- else
- monsterData[wMonster][4][1] = 4
- addMonster(7, curLoc, [point(4, 10), point(0, 4), point(0, 0), 0], 2)
- end if
- if (monsterData[wMonster][4][1] <= 25) and ((monsterData[wMonster][4][1] mod 3) <> 0) then
- set the member of sprite wSprite to "AngryCloud2"
- else
- set the member of sprite wSprite to "AngryCloud1"
- end if
- set the loc of sprite wSprite to monsterData[wMonster][3] - playerViewpoint + rumbleOffset
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(0, 0, 0, 0))
- end case
- else
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(0, 0, 0, 0))
- end if
- next repeat
- end if
- add(monsterHitArea, rect(0, 0, 0, 0))
- add(monsterHarmArea, rect(0, 0, 0, 0))
- end repeat
- end
-